﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Models
{
    public class SysAction:BaseModel
    {
        /// <summary>
        /// 父级ID
        /// </summary>
        public int ParentId { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        /// 
        [StringLength(20)]
        public string Title { get; set; }

        /// <summary>
        /// 动作方法名称
        /// </summary>
        [StringLength(20)]
        public string ActionName { get; set; }

        [StringLength(20)]
        public string ControllerName { get; set; }

        /// <summary>
        /// 提交方式
        /// </summary>
        [StringLength(20)]
        public string Method { get; set; }


        // 前端的请求url
        [StringLength(50)]
        public string Url { get; set; }

        // 图标
        [StringLength(50)]
        public string Icon { get; set; }


        // 是不是菜单
        public bool IsMenu { get; set; } = false;

        // 是否是叶子
        public bool IsLeaf { get; set; }

        public virtual ICollection<SysRole> Roles { get; set; }

        public SysAction()
        {
            this.Roles = new List<SysRole>();
        }
    }
}
